package edu.uw.tcss360.group6.gui;

import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JPanel;

import edu.uw.tcss360.group6.gui.DataCards.*;

/**
 * Created with IntelliJ IDEA.
 * edu.uw.tcss360.group6.model.User: Lemtzas
 * Date: 2/20/13
 * Time: 9:19 PM
 * To change this template use File | Settings | File Templates.
 */
@SuppressWarnings("serial")
public class DataCardPanel extends JPanel {
    private  static int PREFERRED_WIDTH  = 150;
    private  static int PREFERRED_HEIGHT = 150;
    private ContestantCard my_contestant_card;
    private AttendeeCard my_attendee_card;
    private LoginCard my_login_card; //this should not be public - David
    
    public DataCardPanel() {
        super(new CardLayout()); //Should be changed to a different layout
       my_login_card = new LoginCard();
       my_contestant_card = new ContestantCard();
       my_attendee_card = new AttendeeCard();
        this.setBackground(Color.WHITE);
        this.setPreferredSize(new Dimension(PREFERRED_WIDTH, PREFERRED_HEIGHT));
        
        addCards();
    }

 public void setCard(final String the_card) {
        CardLayout cl = (CardLayout)(this.getLayout());
        //TODO: CHANGE TopPanel TITLE
        cl.show(this, the_card);
}

//this is not how this class works - David
// public void setCards(final String[] the_cards)
// {
//
//     for(int i = 0; i < the_cards.length; i++)
//     {
//    	 add(this, the_cards[i]);
//     }
//
// }

    private void addCards() {
        this.add(my_login_card, "login");
        this.add(my_attendee_card,"user");
        this.add(my_contestant_card,"contestant");
        this.add(new JudgeCard(),"judge");
        this.add(new OrganizerCard(),"organizer");
        //we may need or want more cards later, but this should do for now - David
    }
    public AttendeeCard getAttendeeCard()
    {
    	return my_attendee_card;
    }
    public ContestantCard getContestantCard()
    {
    	return my_contestant_card;
    }
    
}
